<template>
	<div class="article-main">
		<h2>{{article.title}}</h2>
		<p style="text-align: right;color:#333333">作者:{{article.author}}</p>
		<p style="text-align: right;color:#333333">时间: {{article.createTime}}</p>
		<p class="summary">概要描述: {{article.summary}}</p>
		<image style="width:100%;margin: 30rpx auto;" :src="article.coverImg" mode=""></image>
		<mp-html :content="article.content2" />
	</div>
</template>

<script setup>
	import {onLoad} from '@dcloudio/uni-app'
	import {reactive, ref} from 'vue'
	import { productArticle } from '@/api/find/index.js'
	const id = ref('')
	const article = ref({})
	onLoad((option)=>{
		id.value = option.articleId;
		getArticleDetail();
	})
	const getArticleDetail = async () => {
		var res = await productArticle(id.value);
		article.value = res.data.productArticle;
		uni.setNavigationBarTitle({
			title:res.data.productArticle.title
		})
	}
</script>

<style lang="scss" scoped>
	.article-main{
		padding: 60rpx;
	}
</style>
